home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / UNIX.ZIP / GUESS / FDES.H < prev    next >
C/C++ Source or Header  |  1991-11-04  |  2KB  |  51 lines

  1. /* Misc defs for the fast password transform.
  2.  */
  3.  
  4. #define reg register
  5. #define uns unsigned
  6. #define    unsb    uns    char
  7. #define    unsl    uns    long
  8.  
  9. /* Types for the different ways to represent DES bit patterns.
  10.  * Bits are always right justified within fields.
  11.  * Bits which have lower indices in the NBS spec are stored in the
  12.  * vax bits with less significance (e.g., Bit 1 of NBS spec is stored
  13.  * in the bit with weight 2 ** 0 to the vax.
  14.  */
  15.  
  16. #define    obpb1        unsb    /* One bit per byte. */
  17. #define    sbpb6        unsb    /* Six bits per byte, 6 held. */
  18. #define    sbpb6R    unsb    /* Six bits per byte Reversed order, 6 held. */
  19. #define    sbpb24    unsl    /* Six bits per byte, 24 held. */
  20. #define    ebpb24    unsl    /* Eight bits per bit, 24 held. */
  21. #define    fbpb4        unsb    /* Four bits per byte, 4 held. */
  22. #define    fbpb4R    unsb    /* Four bits per byte Reversed order, 4 held. */
  23.  
  24. struct passwd{
  25.     char    pw_user[10];    /* User name */
  26.     char    pw_passwd[14];    /* Crypted password */
  27.     int     pw_uid;         /* User id */
  28.     int     pw_gid;         /* Group id */
  29.     char    pw_gecos[40];   /* GCOS entry */
  30.     char    pw_dir[40];        /* home directory */
  31.     char    pw_shell[20];    /* shell used */
  32. };
  33.  
  34. struct passwd2{
  35.     char        pw_user[9];     /* User name */
  36.     char        pw_passwd[9];    /* Decrypted passwd */
  37.     sbpb24      pw_salt;        /* Salt in internal form */
  38.     sbpb24      pw_out96[4];    /* crypted password (output from DES) */
  39.     int         pw_broken;      /* This has been broken flag */
  40. };
  41.  
  42. int         shortcrypt(sbpb24 *out96,sbpb24 salt);
  43. sbpb24     getsaltval(char *);
  44. sbpb24     flatten(char *s,sbpb24 *out96);
  45. char    *expand(sbpb24 *out96);
  46. void     setname(char *);
  47. char    *fcrypt(char *,char *);
  48. struct   passwd *getpwent(char *fn);
  49.  
  50.  
  51.